<template>
  <div>
    <div>
      <el-menu
          :default-active="default_active_nav"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b">
        <el-menu-item index="-1">首页</el-menu-item>
        <el-menu-item index="0">排练</el-menu-item>
        <el-menu-item index="1">场地</el-menu-item>
        <el-menu-item index="2">人员</el-menu-item>
        <el-menu-item index="3">乐器</el-menu-item>
        <el-menu-item index="4">服装</el-menu-item>
        <el-menu-item index="5">奖项</el-menu-item>
        <el-menu-item index="6">个人</el-menu-item>
        <el-menu-item index="7">操作日志</el-menu-item>

      </el-menu>

    </div>
  </div>


</template>


<script>



function permCode2String(code) {
  if (code === 0)
    return '民乐团'
  else return '交响乐团'
}

export default {
  data() {
    return {
      default_active_nav: 0,
    }

  },
  name: "NavBar",
  methods: {

    set_default_active_nav(default_active_nav) {
      this.default_active_nav = default_active_nav
    },
    handleSelect(key, keyPath) {
      switch(key) {
        case '-1':
          this.$router.push({path: '/home'})
          break
        case '0':
          this.$router.push({path: '/rehearse'})
          break
        case '1':
          this.$router.push({path: '/site'})
          break
        case '2':
          this.$router.push({path: '/member'})
          break
        case '3':
          this.$router.push({path: '/instrument'})
          break
        case '4':
          this.$router.push({path: '/clothing'})
          break
        case '5':
          this.$router.push({path: '/award'})
          break
        case '6':
          this.$router.push({path: '/personal'})
          break
        case '7':
          this.$router.push({path: '/operation_log'})
          break
        case '10':
          this.$router.push({path: '/test'})
          break
      }
    },

  }
}
</script>


<style scoped>
</style>